package listbyorder.access001_100.test26;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/5/29 17:16
 */
public class Solution2 {

    // 方法二： 最简单的快慢指针解法
    public int removeDuplicates(int[] nums) {
        int i = 0;
        for (int j = 1; j < nums.length; j++) {
            if (nums[i] != nums[j]) {
                nums[++i] = nums[j];
            }
        }
        return i + 1;
    }
}
